import BlogLayout from '@/layout/index.vue'
import { RouteRecordRaw } from 'vue-router'

const blogRoutes: RouteRecordRaw[] = [
  {
    path: '/overview',
    redirect: '/overview/index',
    component: BlogLayout,
    children: [
      {
        path: '/overview/index',
        component: () => import('@/views/overview.vue')
      },
      {
        path: '/overview/detail/:id',
        name: 'DetailId',
        component: () => import('@/views/detail[id].vue')
      }
    ]
  },
  {
    path: '/category',
    redirect: '/category/index',
    component: BlogLayout,
    children: [
      {
        path: '/category/index',
        component: () => import('@/views/category.vue')
      },
      {
        path: '/category/:name',
        name: 'CategoryName',
        component: () => import('@/views/category[name].vue')
      }
    ]
  },
  {
    path: '/archive',
    redirect: '/archive/index',
    component: BlogLayout,
    children: [
      {
        path: '/archive/index',
        component: () => import('@/views/archive.vue')
      }
    ]
  },
  {
    path: '/search',
    redirect: '/search/index',
    component: BlogLayout,
    children: [
      {
        path: '/search/index',
        component: () => import('@/views/search.vue')
      }
    ]
  }
]

export default blogRoutes
